Signed-off-by: David Scott <dave.scott@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
return r;
}
+static char *xstrdup(const char *x) __attribute__ ((unused));
+static char *xstrdup(const char *x)
+{
+ char *r;
+ r = strdup(x);
+ if (!r) {
+ fprintf(stderr, "xl: Unable to strdup a string of length %zu.\n",
+ strlen(x));
+ exit(-ERROR_FAIL);
+ }
+ return r;
+}
+
#define ARRAY_EXTEND_INIT(array,count,initfn) \
({ \
typeof((count)) array_extend_old_count = (count); \